<template>
  <div class="rockmans-sub">
    <div class="headline">
      <span></span>我订阅的牛人
      <a href="javascript:;" class="more" @click.stop.prevent="toMoreSub">查看更多&gt;</a>
    </div>
    <div class="row list">
      <div class="col-xs-4 no-padding other-detail" v-for="item in manList">
        <div class="entry">
          <div class="up" @click.stop.prevent="toOtherDetail(item)">
            <img :src="item.userHead" class="user-head center-block">
            <div class="nickname text-center">{{item.nickname == '' ? '&nbsp;' : item.nickname}}</div>
            <img src="~assets/images/kapianzhong.png" class="divider">
          </div>
          <div class="down">
            <div class="have-data" v-if="!isNaN(item.operationDirection)">
              <!--仅当操作为创建组合或组合调仓时显示-->
              <div class="action" v-if="item.operationDirection == 1 || item.operationDirection == 2">
                {{item.operationDirectionName}}
              </div>
              <div class="operation-name">
                {{item.operationName}}
              </div>
              <div class="stock-code">
                {{item.stockCode}}
              </div>
              <div v-if="item.operationDirection == 1 || item.operationDirection == 2">
                添加成分股
              </div>

              <!--仅当操作为买入卖出股票时显示-->
              <div v-if="item.operationDirection == 3 || item.operationDirection == 4" class="operation-direction"
                   :class="item.operationDirection == 3 ? 'buy' : 'sell'">
                {{ item.operationDirectionName }}
              </div>
              <div>
                <span class="operation-price">{{ item.operationPrice }}</span>
                <span class="operation-vol">{{ item.operationVol }}</span>
              </div>
              <div class="date-time"><i class="iconfont icon-shijian"></i>{{item.operationDate}}&nbsp;&nbsp;{{item.operationTime}}
              </div>
            </div>
            <div class="no-data" v-else>暂无最新操作</div>
          </div>
        </div>
      </div>
      <div class="no-data" v-if="manList.length == 0">{{error || '暂无数据'}}</div>
    </div>
  </div>
</template>

<script>
  import RemoteDAO from 'common/remoteDAO'
  import CommonUtil from 'common/common.util'
  import LocalDAO from 'common/localDAO'
  import Constant from 'common/constant'
  import _ from 'underscore'

  export default {
    data () {
      return {
      }
    },
    props:{
      manList:{
        type:Array
      },
      error:{
        type:String
      }
    },
    methods: {
      /**
       * 跳转他人详情页
       * @param item
       */
      toOtherDetail (item){
        this.$router.push({path: '/otherdetail', query: {userCode: item.userCode}});
      },
      /**
       * 查看更多我订阅的牛人
       */
      toMoreSub () {
        this.$router.push({path: '/subscriptions'})
      }
    }
  }
</script>

<style scoped>

</style>
